#ifndef __management_struct__
#define __management_struct__
#include <gtk/gtk.h>

#define MENU_NUM 5

enum file_operations
{
    OPEN_FILE,
    SAVE_FILE,
    SAVE_FILE_AS,
};

enum data_conditions
{
    NEW,
    EDITED,
    SEARCH,
};

enum building_columns
{
    POINTER,
    NUMBER,
    NAME,
    PHONE,
    CLASSES,
    STUDENTS,
    SQUARE,
};

enum classroom_colums
{
    POINTER_CLASSROOM,
    NUMBER_BUILDING,
    NUMBER_CLASSROOM,
    FLOOR,
    SQUARE_CLASSROOM,
    STUDENTS_CLASSROOM,
    MEDIA,
};

enum arrangement_colums
{
    POINTER_ARRANGEMENT,
    NUMBER_BUILDING_ARRANGEMENT,
    NUMBER_CLASSROOM_ARRANGEMENT,
    TERM,
    WEEK_OF_TERM,
    WEEKDAY,
    TIME_OF_DAY,
    NAME_ARRANGEMENT,
    STUDENTS_ARRANGEMENT,
    COLLEDGE,
};

enum Weekday {Sun, Mon, Tue, Wed, Thu, Fri, Sat};

typedef struct Building
{
    char number[10];                //编号
    char name[10];                  //名字
    char phone[15];                 //管理员电话
    int number_classrooms;          //教室总间数
    int students;                   //最大容纳学生数
    float square;                   //教室总面积
    struct Building *next;
    struct Classroom *classroom;
} Building;

struct Building_Entry
{
    GtkWidget *entry_number;
    GtkWidget *entry_name;
    GtkWidget *entry_phone;
    GtkWidget *entry_classes;
    GtkWidget *entry_students;
    GtkWidget *entry_square;
};

typedef struct Classroom
{
    char number[10];                //编号
    int floor;                      //所在楼层
    float square;                   //教室面积
    int students;                   //最大容纳学生数
    int has_media;                  //是否为多媒体教室
    struct Classroom *next;
    struct Arrangement *arrangement;
} Classroom;

struct Classroom_Entry
{
    GtkWidget *combo;
    GtkWidget *entry_number;
    GtkWidget *entry_floor;
    GtkWidget *entry_square;
    GtkWidget *entry_students;
    GtkWidget *choice;
};

typedef struct Arrangement
{
    char term[10];                  //学期
    char weeks_of_term[30];         //周次
    enum Weekday weekday;           //星期
    char time_of_day[6];            //节次
    char name[30];                  //课程名
    int students;                   //学生人数
    char colledge[30];              //所属学院
    struct Arrangement *next;
} Arrangement;

struct Arrangement_Entry
{
    GtkWidget *combo;
    GtkWidget *entry_building_number;
    GtkWidget *entry_classroom_number;
    GtkWidget *entry_term;
    GtkWidget *entry_weeks_of_term;
    GtkWidget *entry_weekday;
    GtkWidget *entry_time_of_day;
    GtkWidget *entry_name;
    GtkWidget *entry_students;
    GtkWidget *entry_colledge;
};

struct Count_3_ENTRY
{
    GtkWidget *entry_term;
    GtkWidget *entry_number;
    GtkWidget *entry_week;
    GtkWidget *entry_weekday;
};

struct Count_4_ENTRY
{
    GtkWidget *entry_term;
    GtkWidget *entry_colledge;
};

struct Count_5_ENTRY
{
    GtkWidget *entry_term;
    GtkWidget *entry_arrangement;
};

struct Pop_up_menu_building
{
    GtkWidget *menu;
    GtkTreeSelection *selection;
    GtkTreeView *treeview;
    Building **active;
};

struct Pop_up_menu_classroom
{
    GtkWidget *menu;
    GtkTreeSelection *selection;
    GtkTreeView *treeview;
    Classroom **active;
};

struct Pop_up_menu_arrangement
{
    GtkWidget *menu;
    GtkTreeSelection *selection;
    GtkTreeView *treeview;
    Arrangement **active;
};
#endif
